package com.gis.bigdata.spark.core.rdd.operator.transform

import org.apache.spark.rdd.RDD
import org.apache.spark.{SparkConf, SparkContext}

/**
 * @author LnnuUser
 * @create 2021-08-27-下午6:36
 */
object Spark09_RDD_Operator_Transform {

  def main(args: Array[String]): Unit = {

    val sparkConf: SparkConf = new SparkConf().setMaster("local[*]").setAppName("Operator")
    val sc: SparkContext = new SparkContext(sparkConf)


    // TODO 算子 --sample
    var rdd = sc.makeRDD(List(1,2,3,4,1,2,3,4))

    val distinctRDD: RDD[Int] = rdd.distinct()

    distinctRDD.collect().foreach(println)


    sc.stop()

  }

}
